//@ sourceURL=EquipmentForm.js
EquipmentForm = Ext.extend(Ext.Window,
{
    constructor : function(a) {
        Ext.applyIf(this, a);
        this.initUIComponents();
        EquipmentForm.superclass.constructor.call(this, {
            layout : "fit",
            id : this.inputFormName,
            items : yearGridFormPanel,
            modal : true,
            bodyStyle : "padding:2px;",
            buttonAlign : "center",
            buttons : yearGridFormButtons,
            title : "特种设备信息",
            iconCls : "menu-flowWait",
            width : 620,
            height : 450
        });
    },
    //初始化数据
    initUIComponents : function() {
        createyeargridform({
            operation:this,
            form:{
                saveUrl: __ctxPath+"/equipments/saveEquipment.do",
                items:[
                {
                    id : "equipment.id",
                    name : "equipment.id",
                    xtype : "hidden",
                    value : this.id == null ? "": this.id
                }, {
                    name : "equipment.years",
                    xtype : "hidden",
                    id : "equipment.years",
                    value : this.years == null ? "" : this.years
                },{
				layout : "column",
				//      border:false,
				bodyStyle : "padding:5px;",
				items : [
						{
							layout : "form",
							columnWidth : .5,
							border : false,
							//                        True表示为显示出面板body元素的边框，false则隐藏
							defaultType : "textfield",
							items : [ {
								fieldLabel : '设备名称'
										+ '<font color=red>*</font>',
								id : "equipment.equipmentName",
								name : "equipment.equipmentName",
								maxLength : 80,
								width : 146,
								allowBlank : false,
								blankText : "设备名称不能为空！"
							} ]
						},{
							layout : "form",
							border : false,
							columnWidth : .5,
							items : [ {
								fieldLabel : "设备出厂编号",
								name : "equipment.equipmentCode",
								xtype : "textfield",
								maxLength : 80,
								width : 146,
								allowBlank : true
							} ]
						},{
							layout : "form",
							columnWidth : .5,
							border : false,
							//                        True表示为显示出面板body元素的边框，false则隐藏
							defaultType : "textfield",
							items : [ {
								fieldLabel : '设备规格型号'
										+ '<font color=red>*</font>',
								id : "equipment.specificationsModels",
								name : "equipment.specificationsModels",
								maxLength : 80,
								width : 146,
								allowBlank : false,
								blankText : "设备规格型号不能为空！"
							} ]
						},{
							layout : "form",
							columnWidth : .5,
							border : false,
							items : [ {
								xtype : "datefield",
								fieldLabel : '设备出厂日期'
										+ '<font color=red>*</font>',
								id : "equipment.leaveFactoryData",
								format : "y-m-d",
								name : "equipment.leaveFactoryData",
								width : 146,
								allowBlank : false,
								blankText : "出厂日期不能为空！"
							} ]
							} ,{
							layout : "form",
							columnWidth : .5,
							border : false,
							//                        True表示为显示出面板body元素的边框，false则隐藏
							defaultType : "textfield",
							items : [ {
								fieldLabel : "使用状态",
								id : "equipment.equmentState",
								name : "equipment.equmentState",
								xtype : "combo",
								mode : "local",
								editable : false,
								width : 146,
								triggerAction : "all",
								store : [
										[ "1",  "使用" ],
										[ "2",  "维修" ],
										[ "3",	"闲置" ] ,
										[ "3",	"废弃" ] ],
								//value : 4
							} ]
						},{
							layout : "form",
							columnWidth : .5,
							border : false,
							items : [ {
								xtype : "datefield",
								fieldLabel : '设备启用时间'
										+ '<font color=red>*</font>',
								id : "equipment.startUsingData",
								format : "y-m-d",
								name : "equipment.startUsingData",
								width : 146,
								allowBlank : false,
								blankText : "启用时间不能为空！"
							} ]
						},{
							layout : "form",
							columnWidth : .5,
							border : false,
							//                        True表示为显示出面板body元素的边框，false则隐藏
							defaultType : "textfield",
							items : [ {
								fieldLabel : "安装地点",
								id : "equipment.installPlace",
								name : "equipment.installPlace",
								maxLength : 80,
								width : 146,
								allowBlank : true

							} ]
						},{
							layout : "form",
							columnWidth : .5,
							border : false,
							items : [ {
								xtype : "textfield",
								fieldLabel : '使用单位'
										+ '<font color=red>*</font>',
								id : "equipment.userUnit",
								format : "y-m-d",
								name : "equipment.userUnit",
								width : 146,
								allowBlank : false,

							} ]
						
						},{
						layout : "form",
						border:false,
						//bodyStyle : "padding:5px;",
						columnWidth : .5,
						items : [ {
							xtype : "textfield",
							fieldLabel : '制造厂家',
							name : 'equipment.zhizaoVender',
							/*maxLength:300,
							height:25,*/
							width : 146
						} ]
					},
					{
						columnWidth : .5,//第一列 
						layout : "form",
						 border : false,
						//bodyStyle : "padding:5px;",
						items : [ {
							xtype : "textfield",
							fieldLabel : '责任人',
							name : 'equipment.dutyPerson',
							width : 146
						} ]
					},{

						columnWidth : 1.,//第一列 
						layout : "form",
						 border : false,
						//bodyStyle : "padding:5px;",
						items : [ {
							xtype : "textarea",
							fieldLabel : '备注',
							name : 'equipment.remark',
							width : 448
						} ]
						
					} ]
			}]
            },
            loadData:{
                getUrl:__ctxPath +"/equipments/getEquipment.do",
                preName : "equipment"
            },
            isShow : this.isShow
        });
    }
});
